package com.sdlg.controller;

import com.sdlg.pojo.BookGroup;
import com.sdlg.service.PermissionService;
import com.sdlg.util.PageResult;
import com.sdlg.util.QueryPageBean;
import com.sdlg.util.Result;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/permission")
public class PermissionController {
    @Resource
    private PermissionService permissionService;

    @RequestMapping("/findPageInfo")
    public Result findPageInfo(@RequestBody QueryPageBean queryPageBean){
        Result result=permissionService.findPageInfo(queryPageBean);
        System.out.println("==========================");
        System.out.println(result);;
        return result;
    }

    @RequestMapping("/getAllMenuInfo")
    private Result getAllItemInfo(){
        Result result=permissionService.getAllMenuInfo();
        return result;
    }

    @RequestMapping("/getRoleids")
    private Result getRoleids(@RequestBody QueryPageBean queryPageBean){
        Result result=permissionService.getRoleids(queryPageBean);
        return result;
    }
    @RequestMapping("/saveGroupInfo")
    public Result saveGroupInfo(Integer[] ids,@RequestBody QueryPageBean queryPageBean){
        Result result=permissionService.saveGroupInfo(ids,queryPageBean);
        return result;
    }


}
